<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: GData::Auth::AuthSub</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">GData::Auth::AuthSub</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/lib/gdata/auth/authsub_rb.html">
                lib/gdata/auth/authsub.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This class implements <a href="AuthSub.html">AuthSub</a> signatures for
Data API requests. It can be used with a <a
href="../../GData.html">GData::Client::GData</a> object.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000053">get_url</a>&nbsp;&nbsp;
      <a href="#M000051">info</a>&nbsp;&nbsp;
      <a href="#M000047">new</a>&nbsp;&nbsp;
      <a href="#M000048">private_key=</a>&nbsp;&nbsp;
      <a href="#M000052">revoke</a>&nbsp;&nbsp;
      <a href="#M000049">sign_request!</a>&nbsp;&nbsp;
      <a href="#M000050">upgrade</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">REQUEST_HANDLER</td>
          <td>=</td>
          <td class="context-item-value">'https://www.google.com/accounts/AuthSubRequest'</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
The URL of AuthSubRequest.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">SESSION_HANDLER</td>
          <td>=</td>
          <td class="context-item-value">'https://www.google.com/accounts/AuthSubSessionToken'</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
The URL of AuthSubSessionToken.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">REVOKE_HANDLER</td>
          <td>=</td>
          <td class="context-item-value">'https://www.google.com/accounts/AuthSubRevokeToken'</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
The URL of AuthSubRevokeToken.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">INFO_HANDLER</td>
          <td>=</td>
          <td class="context-item-value">'https://www.google.com/accounts/AuthSubTokenInfo'</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
The URL of AuthSubInfo.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">BIG_INT_MAX</td>
          <td>=</td>
          <td class="context-item-value">18446744073709551616</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
2 ** 64, the largest 64 bit unsigned integer

</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">private_key</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
Private RSA key used to sign secure requests.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">token</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
<a href="AuthSub.html">AuthSub</a> access token.

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000053" class="method-detail">
        <a name="M000053"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000053.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000053.html');return false;">
          <span class="method-name">get_url</span><span class="method-args">(next_url, scope, secure = false, session = true, domain = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return the proper URL for an <a href="AuthSub.html">AuthSub</a> approval
page with the requested scope. next_url should be a URL that points back to
your code that will receive the token. domain is optionally a Google Apps
domain.
</p>
        </div>
      </div>

      <div id="method-M000047" class="method-detail">
        <a name="M000047"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000047.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000047.html');return false;">
          <span class="method-name">new</span><span class="method-args">(token, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Initialize the class with a <a href="AuthSub.html#M000047">new</a> token.
Optionally pass a private key or custom URLs.
</p>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000051" class="method-detail">
        <a name="M000051"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000051.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000051.html');return false;">
          <span class="method-name">info</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return some information about the current token. If the current token is a
one-time use token, this operation will use it up!
</p>
        </div>
      </div>

      <div id="method-M000048" class="method-detail">
        <a name="M000048"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000048.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000048.html');return false;">
          <span class="method-name">private_key=</span><span class="method-args">(key)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Set the private key to use with this <a href="AuthSub.html">AuthSub</a>
token. The key can be an OpenSSL::PKey::RSA object, a string containing a
private key in PEM format, or a string specifying a path to a PEM file that
contains the private key.
</p>
        </div>
      </div>

      <div id="method-M000052" class="method-detail">
        <a name="M000052"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000052.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000052.html');return false;">
          <span class="method-name">revoke</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Revoke the token.
</p>
        </div>
      </div>

      <div id="method-M000049" class="method-detail">
        <a name="M000049"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000049.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000049.html');return false;">
          <span class="method-name">sign_request!</span><span class="method-args">(request)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sign a GData::Http::Request object with a valid <a
href="AuthSub.html">AuthSub</a> Authorization header.
</p>
        </div>
      </div>

      <div id="method-M000050" class="method-detail">
        <a name="M000050"></a>

        <div class="method-heading">
          <a href="AuthSub.src/M000050.html" target="Code" class="method-signature"
            onclick="popupCode('AuthSub.src/M000050.html');return false;">
          <span class="method-name">upgrade</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Upgrade the current token into a session token.
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>